package ru.spb.bragnikita.myevents.ajax;

import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

/**
 * @author Nikita.Brazhnikov
 */
@Named("ajax_session")
@SessionScoped
public class AjaxBean implements Serializable {

	private List<String> values = new LinkedList<String>();


	public boolean isNameFree(String name) {
		if (name.equals("Haji"))
			return false;
		return true;
	}

	public synchronized List<String> getListValues() {
		return values;
	}

	public void addValue(String newValue) {
		values.add(newValue);
	}
}
